//
//  QZCheckNetwork.m
//  SidePatient
//
//  Created by 上官惠阳 on 15/10/31.
//  Copyright © 2015年 上官惠阳. All rights reserved.
// 检测网络状态用的

#import "QZCheckNetwork.h"
#import "AFNetworking.h"
#import "Reachability.h"

@implementation QZCheckNetwork
//检测联网状态
+ (BOOL)isNetworkConnected {
    Reachability *r = [Reachability reachabilityWithHostName:@"www.baidu.com"];
    switch ([r currentReachabilityStatus]) {
        case NotReachable:
            return NO;
            break;
        case ReachableViaWWAN:
        case ReachableViaWiFi:
            return YES;
            break;
    }
}
@end
